package com.yayo.mangement.service.impl;

import com.yayo.mangement.dao.SysRoleMenuDao;
import com.yayo.mangement.model.SysRoleMenuDO;
import com.yayo.mangement.service.SysRoleMenuService;
import com.yayo.mangement.paging.PageInfo;
import com.yayo.mangement.paging.Paging;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 * @author: Yayo
 * @date: 2020-08-07 14:08:42
 */
@Service
public class SysRoleMenuServiceImpl implements SysRoleMenuService{

    @Autowired
    private SysRoleMenuDao sysRoleMenuDao;

    @Override
    public Paging<SysRoleMenuDO> paging(Integer pageNo, Integer pageSize,Map<String,Object> params){
        PageInfo pageInfo = new PageInfo(pageNo, pageSize);
        params.put("limit", pageInfo.getLimit());
        params.put("offset", pageInfo.getOffset());
        return sysRoleMenuDao.paging(params);
    }

    @Override
    public SysRoleMenuDO findById(Long id){
        return sysRoleMenuDao.findById(id);
    }

    @Override
    public Boolean create(SysRoleMenuDO sysRoleMenuDO){
        return sysRoleMenuDao.create(sysRoleMenuDO);
    }

    @Override
    public Boolean updateById(SysRoleMenuDO sysRoleMenuDO){
        return sysRoleMenuDao.update(sysRoleMenuDO);
    }

    @Override
    public Boolean delete(Long id){
        return sysRoleMenuDao.delete(id);
    }

    @Override
    public List<SysRoleMenuDO> findByRoleIdList(List<Long> roleIdList) {
        return sysRoleMenuDao.findByRoleIdList(roleIdList);
    }
}